package cn.usian.jyzx.product.controller;

import cn.usian.jyzx.model.entity.product.Brand;
import cn.usian.jyzx.model.vo.common.Result;
import cn.usian.jyzx.model.vo.common.ResultCodeEnum;
import cn.usian.jyzx.product.service.BrandService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 06 19 10 40
 **/
@Tag(name = "品牌管理")
@RestController
@RequestMapping(value="/api/product/brand")
public class BrandController {
    @Autowired
    private BrandService brandService;

    @GetMapping("/brand/findAll")
    @Operation(summary = "查询所有品牌")
    public Result<List<Brand>> findAll(){
        List<Brand> brandList =  brandService.findAll();
        return Result.build(brandList, ResultCodeEnum.SUCCESS);
    }
}
